<template>
	<view class="beijingse dingwei">
		<view class="flexcenter ffffff ">
			<u-tabs :list="list1" lineColor="#FAB536" @click="clicktabtow" :activeStyle="{
			    color: '#000000',
			    fontWeight: 'bold',
			    transform: 'scale(1.05)'
			}" :inactiveStyle="{
			            color: '#666666',
						 fontWeight: 'bold',
			            transform: 'scale(1)'
			        }" itemStyle="padding-left: 50px; padding-right: 50px; height: 44px;"></u-tabs>
		</view>
		<!-- 内容 -->
		<view class="mainpadding2">
			<view class="">
				<view class="zwtimg flexcenter" v-if="!list.data.length">
					<image src="../../static/image/system/zwt.png" mode=""></image>
				</view>
				<view class="mainpadding_top ffffff radius" v-if="list.data.length" v-for="item in list.data" :key="item.id">
					<view class="flexbetween">
						<view class="ershisi">订单编号：{{item.order.order_no}}</view>
						<view class="huangsetext" v-if="item.status==1">进行中</view>
						<view class="yiwanc" v-if="item.status==2">已完成</view>
					</view>
					<view class="flexbetween margin_top" @click="tzddxq(item.id)">
						<view class="shilitu">
							<image :src="item.stycinfo.image_text" mode=""></image>
						</view>
						<view class="" style="width: 74%;">
							<view class="ershib">{{item.stycinfo.title}}</view>
							<view class="margin_top1 lhxk ershil">{{item.stycinfo.des}}</view>
						</view>
					</view>
					<view class="">
						<view class="flexright margin_top">
							<!-- 取消订单 -->
							<view class="huisebtn" @click="tzddxq(item.id)">订单详情</view>
							<!-- 立即支付 -->
							<view class="huangsebtn marginleft3" @click="tzsyxq(item.id)">收益详情</view>
						</view>

					</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				currenttabtow: 0,
				list1: [{
						name: '全部',
					},
					{
						name: '进行中',
					},
					{
						name: '已完成',
					},
				],
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onShow() {
			this.init()
		},
		// 右上角文字回调事件
		// onNavigationBarButtonTap(e) {
		// 	uni.navigateTo({
		// 		url: `/pages/mypage/shouyixq`,
		// 	})
		// },
		methods: {
			// 热门推荐列表
			init(isPage, page) {
				let _this = this;
				httpRequest.request('/api/stycorder/myStyc', 'POST', {
					page: page || 1,
					limit: _this.limit,
					status: this.currenttabtow
				}, false, false, true).then(res => {
					if (res.code == 1) {
						res.data.data.forEach(item => {
							this.$set(item, "is_zk", false)
						})
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
			changezk(item) {
				item.is_zk = !item.is_zk
			},
			// 跳转订单详情
			tzddxq(id) {
				uni.navigateTo({
					url: '/pages/mypage/yunchangstxq?id='+id
				})
			},
			// 跳转收益详情
			tzsyxq(id){
				uni.navigateTo({
					url: `/pages/mypage/shouyixq?styc_account_id=${id}`,
				})
			},
			clicktabtow(e) {
				this.currenttabtow = e.index;
				this.init()
			},
		}
	}
</script>

<style lang="scss" scoped>
	.huisebtn {
		margin-right: 30rpx;
		border: 2rpx solid #666666;
		width: 170rpx;
		height: 67rpx;
		display: flex;
		border-radius: 120rpx;
		align-items: center;
		justify-content: center;
		font-size: 26rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #666666;
	}
	.huangsebtn {
		border: 2rpx solid #FAB536;
		width: 170rpx;
		height: 67rpx;
		display: flex;
		border-radius: 120rpx;
		align-items: center;
		justify-content: center;
		font-size: 26rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FAB536;
	}
	.zitidw {
		position: absolute;
		top: 30rpx;
		right: 30rpx;
	}

	.hxhx {
		padding-bottom: 30rpx;
		border-bottom: 1rpx solid rgba(0, 0, 0, 0.05);
	}

	.zhankai {
		transform: rotate(-90deg);
		transition: all .5s;
		width: 28rpx;
		height: 28rpx;
		background-size: 100% 100%;
		background-image: url('../../static/image/system/zhankai.png');
	}

	.shouqi {
		// transform:rotate(90deg);
		transition: all .5s;
		width: 28rpx;
		height: 28rpx;
		background-size: 100% 100%;
		background-image: url('../../static/image/system/zhankai.png');
	}

	.huibox {
		background: #F1F1F1;
		border-radius: 10rpx;
	}

	.lvsetext {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #28C445;
	}

	.huisetext {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #666666;
	}

	.hongsetext {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FF0000;
	}

	.ershib {
		font-size: 28rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 800;
		color: #333333;
	}

	.shilitu {
		width: 134rpx;
		height: 128rpx;
		border-radius: 14rpx;

		image {
			width: 100%;
			height: 100%;
			border-radius: 14rpx;
		}
	}

	.yiwanc {
		font-size: 24rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #28C445;
	}

	.huangsetext {
		font-size: 24rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #FAB536;
	}

	.ershisi {
		font-size: 24rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #333333;
	}

	.lhxk {
		font-weight: normal;
		text-overflow: -o-ellipsis-lastline;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		/*重点，不能用block等其他*/
		-webkit-line-clamp: 2;
		/*重点IE和火狐不支持*/
		-webkit-box-orient: vertical;
		/*重点*/
	}
</style>
